package com.mr.dao.entity.customer;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.mr.constants.Tables;
import com.mr.dao.entity.BaseEntity;
import com.mr.dao.entity.product.Subproduct;

@Entity(name = Tables.PROMO)
public class Promo extends BaseEntity {
	private static final long serialVersionUID = 2170447272046544884L;
	private String promo_id;
	private Calendar valid_date;
	private int discount_pct;
	private BigDecimal shipping_price;
	private BigDecimal sub_total;
	@ManyToOne
	private Customer customer_account;
	@ManyToOne
	private Subproduct subproduct;
	@OneToMany(mappedBy = "promo", cascade = CascadeType.ALL)
	private List<TmpOrderedSubproduct> tmpOrderedSubproducts = new ArrayList<TmpOrderedSubproduct>(0);

	public String getPromo_id() {
		return promo_id;
	}

	public void setPromo_id(String promo_id) {
		this.promo_id = promo_id;
	}

	public Calendar getValid_date() {
		return valid_date;
	}

	public void setValid_date(Calendar valid_date) {
		this.valid_date = valid_date;
	}

	public int getDiscount_pct() {
		return discount_pct;
	}

	public void setDiscount_pct(int discount_pct) {
		this.discount_pct = discount_pct;
	}

	public BigDecimal getShipping_price() {
		return shipping_price;
	}

	public void setShipping_price(BigDecimal shipping_price) {
		this.shipping_price = shipping_price;
	}

	public BigDecimal getSub_total() {
		return sub_total;
	}

	public void setSub_total(BigDecimal sub_total) {
		this.sub_total = sub_total;
	}

	public Customer getCustomer_account() {
		return customer_account;
	}

	public void setCustomer_account(Customer customer_account) {
		this.customer_account = customer_account;
	}

	public Subproduct getSubproduct() {
		return subproduct;
	}

	public void setSubproduct(Subproduct subproduct) {
		this.subproduct = subproduct;
	}

	public List<TmpOrderedSubproduct> getTmpOrderedSubproducts() {
		return tmpOrderedSubproducts;
	}

	public void setTmpOrderedSubproducts(List<TmpOrderedSubproduct> tmpOrderedSubproducts) {
		this.tmpOrderedSubproducts = tmpOrderedSubproducts;
	}
}
